package com.cx.dao;

import com.cx.domain.goods;
import com.cx.domain.goodsview;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public interface goodsDao {
    @Select("SELECT max(ID) FROM goods")
    String selectid();
    @Select("SELECT * FROM `goodsview`")
    List<goodsview> selectall();
    @Insert("INSERT INTO goods (`goods_name`,goods_type_id,price)  VALUES(#{name},#{type},#{price})")
    int insertgoods(@Param("name")String name,@Param("type")String type,@Param("price") String price);
    @Delete("DELETE FROM goods WHERE id=#{id}")
    void delete (@Param("id")String id);
    @Update("UPDATE goods SET `goods_name`=#{name} ,goods_type_id=#{type}, price=#{price} WHERE id=#{id}")
    void update(@Param("name")String name,@Param("type") String type,@Param("price") String price,@Param("id")String id);
}
